import com.plealog.genericapp.api.EZEnvironment;
import com.plealog.genericapp.api.EZGenericApplication;
import com.plealog.genericapp.api.EZUIStarterListener;

import javax.swing.*;
import java.awt.*;

public class Main {
	public static void main(String[] args) {
		EZGenericApplication.initialize("校园社团物品借用与领用管理平台系统");

		EZEnvironment.setUIStarterListener(new MyStarterListener());
		EZGenericApplication.startApplication(args);
	}

	private static class MyStarterListener implements EZUIStarterListener {

		@Override
		public void preStart() {

		}

		@Override
		public void postStart() {
			JFrame frame = EZEnvironment.getParentFrame();
			JMenuBar menuBar = new JMenuBar();

			JMenu menu = new JMenu();
			menu.setIcon(EZEnvironment.getImageIcon("copy.png"));
			menuBar.setLayout(new FlowLayout(FlowLayout.RIGHT,0,0));
			menuBar.add(menu);
			System.out.println(menu.getPreferredSize());

			frame.setJMenuBar(menuBar);
		}

		@Override
		public void frameDisplayed() {

		}

		@Override
		public Component getApplicationComponent() {
			return null;
		}

		@Override
		public boolean isAboutToQuit() {
			return true;
		}
	}
}
